package com.studentstreet.entities;

import java.util.Date;

import android.os.Parcel;
import android.os.Parcelable;

public class GoodsEntity implements Parcelable {
	private int id = 0;
	private int classId = 0;
	private String name = "";
	private int sellerId = 0;
	private String sellerName = "";
	private int saleClass = 0;
	private double price = 0;
	private double discount = 1;
	private String imageUrl = "";
	private String nutrition = "";
	private String keyWords = "";
	private String descrition = "";
	private int saleCount = 0;
	private String onSaleTime = null;
	private double rank;
	private String className = "";
	private String imageUrl2 = "";
	private String imageUrl3 = "";
	// OEM 2013-05-08 商品状态和下架时间
	private int state = 1;
	private String offlineTime;

	public GoodsEntity() {
		super();
	}

	public GoodsEntity(int id, int classId, String name, int sellerId,
			String sellerName, int saleClass, double price, double discount,
			String imageUrl, String nutrition, String keyWords,
			String descrition, int saleCount, String onSaleTime, double rank,
			String className, String imageUrl2, String imageUrl3, int state,
			String offlineTime) {
		super();
		this.id = id;
		this.classId = classId;
		this.name = name;
		this.sellerId = sellerId;
		this.sellerName = sellerName;
		this.saleClass = saleClass;
		this.price = price;
		this.discount = discount;
		this.imageUrl = imageUrl;
		this.nutrition = nutrition;
		this.keyWords = keyWords;
		this.descrition = descrition;
		this.saleCount = saleCount;
		this.onSaleTime = onSaleTime;
		this.rank = rank;
		this.className = className;
		this.imageUrl2 = imageUrl2;
		this.imageUrl3 = imageUrl3;
		this.state = state;
		this.offlineTime = offlineTime;
	}

	public int getId() {
		return id;
	}

	public int getClassId() {
		return classId;
	}

	public String getName() {
		return name;
	}

	public int getSellerId() {
		return sellerId;
	}

	public String getSellerName() {
		return sellerName;
	}

	public int getSaleClass() {
		return saleClass;
	}

	public double getPrice() {
		return price;
	}

	public double getDiscount() {
		return discount;
	}

	public String getImageUrl() {
		return imageUrl;
	}

	public String getNutrition() {
		return nutrition;
	}

	public String getKeyWords() {
		return keyWords;
	}

	public String getDescrition() {
		return descrition;
	}

	public int getSaleCount() {
		return saleCount;
	}

	public String getOnSaleTime() {
		return onSaleTime;
	}

	public double getRank() {
		return rank;
	}

	public String getClassName() {
		return className;
	}

	public String getImageUrl2() {
		return imageUrl2;
	}

	public String getImageUrl3() {
		return imageUrl3;
	}

	public int getState() {
		return state;
	}

	public String getOfflineTime() {
		return offlineTime;
	}

	public void setId(int id) {
		this.id = id;
	}

	public void setClassId(int classId) {
		this.classId = classId;
	}

	public void setName(String name) {
		this.name = name;
	}

	public void setSellerId(int sellerId) {
		this.sellerId = sellerId;
	}

	public void setSellerName(String sellerName) {
		this.sellerName = sellerName;
	}

	public void setSaleClass(int saleClass) {
		this.saleClass = saleClass;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	public void setDiscount(double discount) {
		this.discount = discount;
	}

	public void setImageUrl(String imageUrl) {
		this.imageUrl = imageUrl;
	}

	public void setNutrition(String nutrition) {
		this.nutrition = nutrition;
	}

	public void setKeyWords(String keyWords) {
		this.keyWords = keyWords;
	}

	public void setDescrition(String descrition) {
		this.descrition = descrition;
	}

	public void setSaleCount(int saleCount) {
		this.saleCount = saleCount;
	}

	public void setOnSaleTime(String onSaleTime) {
		this.onSaleTime = onSaleTime;
	}

	public void setRank(double rank) {
		this.rank = rank;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	public void setImageUrl2(String imageUrl2) {
		this.imageUrl2 = imageUrl2;
	}

	public void setImageUrl3(String imageUrl3) {
		this.imageUrl3 = imageUrl3;
	}

	public void setState(int state) {
		this.state = state;
	}

	public void setOfflineTime(String offlineTime) {
		this.offlineTime = offlineTime;
	}

	@Override
	public String toString() {
		return "GoodsEntity [id=" + id + ", classId=" + classId + ", name="
				+ name + ", sellerId=" + sellerId + ", sellerName="
				+ sellerName + ", saleClass=" + saleClass + ", price=" + price
				+ ", discount=" + discount + ", imageUrl=" + imageUrl
				+ ", nutrition=" + nutrition + ", keyWords=" + keyWords
				+ ", descrition=" + descrition + ", saleCount=" + saleCount
				+ ", onSaleTime=" + onSaleTime + ", rank=" + rank
				+ ", className=" + className + ", imageUrl2=" + imageUrl2
				+ ", imageUrl3=" + imageUrl3 + ", state=" + state
				+ ", offlineTime=" + offlineTime + "]";
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(id);
		dest.writeInt(classId);
		dest.writeString(name);
		dest.writeInt(sellerId);
		dest.writeString(sellerName);
		dest.writeInt(saleClass);
		dest.writeDouble(price);
		dest.writeDouble(discount);
		dest.writeString(imageUrl);
		dest.writeString(nutrition);
		dest.writeString(descrition);
		dest.writeString(keyWords);
		dest.writeInt(saleCount);
		dest.writeDouble(rank);
		dest.writeString(className);
		dest.writeInt(state);
		dest.writeString(offlineTime);
	}

	public static final Parcelable.Creator<GoodsEntity> CREATOR = new Creator<GoodsEntity>() {
		@Override
		public GoodsEntity createFromParcel(Parcel p) {
			GoodsEntity goods = new GoodsEntity();
			goods.id = p.readInt();
			goods.classId = p.readInt();
			goods.name = p.readString();
			goods.sellerId = p.readInt();
			goods.sellerName = p.readString();
			goods.saleClass = p.readInt();
			goods.price = p.readDouble();
			goods.discount = p.readDouble();
			goods.imageUrl = p.readString();
			goods.nutrition = p.readString();
			goods.descrition = p.readString();
			goods.keyWords = p.readString();
			goods.saleCount = p.readInt();
			goods.rank = p.readDouble();
			goods.className = p.readString();
			goods.state = p.readInt();
			goods.offlineTime = p.readString();
			return goods;
		}

		@Override
		public GoodsEntity[] newArray(int size) {
			return new GoodsEntity[size];
		}

	};

}
